package com.powersystem.demo.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.powersystem.demo.entity.Flawlog;
import com.powersystem.demo.mapper.FlawlogMapper;
import com.powersystem.demo.service.IFlawlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author linrongji
 * @since 2019-11-21
 */
@RestController

public class FlawlogController {

    @Autowired
    private IFlawlogService ifls;

    //插入一條記錄
    @RequestMapping("addFlawlog")
    public boolean addFlawlog(Flawlog fl){
        return ifls.save(fl);
    }

    // 根據ID修改是否啓動
    @RequestMapping("upFlawlog")
    public boolean upFlawlog(Flawlog fl){
        return ifls.updateById(fl);
    }

    // 根據ID刪除
    @RequestMapping("deleFlawlog")
    public boolean deleFlawlog(int id){
        return ifls.removeById(id);
    }

}

